package com.yhty.web.action;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import com.yhty.model.OweList;
import com.yhty.service.OweManager;

/**
 * 欠费action
 * @author RoySong
 * 2011-4-2-上午09:50:04
 */
@Controller
@RequestMapping("/owe")
public class OweAction {
	private OweManager oweManager;

	/**
	 * 按月份获取欠费详情列表
	 * @param date 如果为空,则取本月
	 * @return
	 */
	@RequestMapping(value="list",method=RequestMethod.GET)
	public @ResponseBody List<OweList>
		list(@RequestParam(value="date",required=false)
			String date){
		return oweManager.getByMonth(date);
	}

	@Resource(name="oweManager")
	public void setOweManager(OweManager oweManager) {
		this.oweManager = oweManager;
	}
}
